libxl: don't add cache mode for qdisk cdrom drives
authorJim Fehlig <jfehlig@suse.com>
Thu, 28 Apr 2016 21:20:46 +0000 (15:20 -0600)
committerWei Liu <wei.liu2@citrix.com>
Sun, 15 May 2016 15:07:32 +0000 (16:07 +0100)
commitd532f45d94c412d6ee0491cd0b44946373ff2268
tree385434d8c7f963f4d5fc058cdcd20189c4a47700
parent4f6aea066fe2cf3bf4929d6dac1e558071566f73
libxl: don't add cache mode for qdisk cdrom drives

qemu commit 91a097e7 forbids specifying cache mode for empty
drives. Attempting to create a domain with an empty qdisk cdrom
drive results in

qemu-system-x86_64: -drive if=ide,index=1,readonly=on,media=cdrom,
   cache=writeback,id=ide-832: Must specify either driver or file

libxl only allows an empty 'target=' for cdroms. By default, cdroms
are readonly (see the 'access' parameter in xl-disk-configuration.txt)
and forced to readonly by any tools (e.g. xl) using libxlutil's
xlu_disk_parse() function. With cdroms always marked readonly,
explicitly specifying the cache mode for cdrom drives can be dropped.
The drive's 'readonly=on' option can also be set unconditionally.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_dm.c